package ejb;

import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import singleton.CompraControleRemote;
import stateful.ProdutoControleRemote;

/**
 *
 * @author Rodrigo Felipe
 */
public class FabricaRequisicoes {

    public ProdutoControleRemote novoProdutoRemote() throws NamingException {
//        Properties props = new Properties();
//        props.put("org.omg.CORBA.ORBInitialHost","192.168.1.3");
//        props.put("org.omg.CORBA.ORBInitialPort","3700");
//        Context ctx = new InitialContext(props);
        Context ctx = new InitialContext();
        return (ProdutoControleRemote) ctx.lookup(
                "java:global/Servidor/Servidor-ejb/ProdutoControle!stateful.ProdutoControleRemote");

    }

    public CompraControleRemote novoCompraRemote() throws NamingException {
//        Properties props = new Properties();
//        props.put("org.omg.CORBA.ORBInitialHost","192.168.1.3");
//        props.put("org.omg.CORBA.ORBInitialPort","3700");
//        Context ctx = new InitialContext(props);
        Context ctx = new InitialContext();
        return (CompraControleRemote) ctx.lookup(
                "java:global/Servidor/Servidor-ejb/CompraControle!singleton.CompraControleRemote");
    }

}
